import React from 'react';
import ReactDOM from 'react-dom';
// import PropTypes from 'prop-types';
import store from './store/store'
import './index.css';
import App from './App';

import {Provider} from 'react-redux';
import registerServiceWorker from './registerServiceWorker';

// function createStore(reducer) {
//     let state = null
//     const listeners = []
//     const subscribe = (listener) => listeners.push(listener)
//     const getState = () => state
//     const dispatch = (action) => {
//         state = reducer(state, action)
//         listeners.forEach((listener) => listener())
//     }
//     dispatch({}) // 初始化 state
//     return {getState, dispatch, subscribe}
// }



ReactDOM.render(
    <Provider store={store}>
        <App />
    </Provider>, document.getElementById('root'));
registerServiceWorker();
